﻿Imports System
Imports System.Diagnostics.CodeAnalysis
Imports System.Runtime.Serialization
Imports System.Security.Permissions

Namespace System.Workflow.Activities.Rules
    <Serializable, SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic")> _
    Friend Class RuleSyntaxException
        Inherits SystemException
        ' Methods
        Friend Sub New()
        End Sub

        <SecurityPermission(SecurityAction.Demand, SerializationFormatter:=True)> _
        Private Sub New(ByVal serializeInfo As SerializationInfo, ByVal context As StreamingContext)
            MyBase.New(serializeInfo, context)
        End Sub

        Friend Sub New(ByVal errorNumber As Integer, ByVal message As String, ByVal position As Integer)
            MyBase.New(message)
            Me.errorNumber = errorNumber
            Me.position = position
        End Sub


        ' Properties
        Friend ReadOnly Property ErrorNumber As Integer
            Get
                Return Me.errorNumber
            End Get
        End Property

        Friend ReadOnly Property Position As Integer
            Get
                Return Me.position
            End Get
        End Property


        ' Fields
        Private errorNumber As Integer
        Private position As Integer
    End Class
End Namespace

